﻿using System;
using System.Collections.Generic;
using Jayden.Dll.Web.Enums;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Caption : HtmlElement
	{
		public Caption() : base(CaptionDescription.Instance) { }
		public Caption(string text)
			: this()
		{
			if (text != null)
				AddText(text);
		}
	}
	public class CaptionDescription : HtmlElementDescription
	{
		public static readonly CaptionDescription Instance = new CaptionDescription();
		private CaptionDescription() : base("caption", HtmlVersion.Html4, true, true) { }
		public override Type ControlType { get { return typeof(Caption); } }
		public override bool OnlyFlowContent { get { return true; } }
		public override string Description { get { return "title of the table that is its parent."; } }
		public override bool AllowInnerText { get { return true; } }
		public override IEnumerable<HtmlElementDescription> PermittedParents { get { yield return TableDescription.Instance; } }
	}
}
